package cn.jinshengda.controller;


import cn.jinshengda.entity.Position;
import cn.jinshengda.service.PositionService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2022-01-08
 */
@RestController
@CrossOrigin
public class PositionController {

    @Autowired
    private PositionService positionService;

    @GetMapping("position/{departmentId}")
    public List<Position> queryByDeptId(@PathVariable Integer departmentId){
        QueryWrapper<Position> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("department_id", departmentId);
        List<Position> list = positionService.list(queryWrapper);
        return list;
    }
}

